package com.android.RssReader.Adapter;

import java.util.List;
import java.util.Map;

import com.android.RssReader.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class CustomSimpleAdapter extends SimpleAdapter{
    private int index = 0;
	
	public CustomSimpleAdapter(Context context,
			List<? extends Map<String, ?>> data, int resource, String[] from,
			int[] to) {
		super(context, data, resource, from, to);
	}
	
	public void setPosition(int position){
		index = position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View v = super.getView(position, convertView, parent);
	    if (position == index){
	    	TextView categoryTitle = (TextView) v;
	    	categoryTitle.setBackgroundResource(R.drawable.image_categorybar_item_selected_background);
	    	categoryTitle.setTextColor(0XFFFFFFFF);
	    }
		return v;
	}
	
	

}
